home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Education / Modern Media / olisDemo / Shared.DIR / 02008_Shared Cast scripts.ls < prev    next >
Encoding:
Text File  |  1995-04-13  |  4.3 KB  |  192 lines

  1. on initBudMeterCast
  2.   global meterLevel, moduleList, fileSep
  3.   if not meterLevel or (meterLevel < 1) or (meterLevel > 3) then
  4.     set meterLevel to 1
  5.   end if
  6.   initSharedCast()
  7.   if not moduleList then
  8.     budMeterSetup()
  9.   end if
  10.   when keyDown then setVolume()
  11. end
  12.  
  13. on getBudPath budHotSpotNum
  14.   setAnimationCursor()
  15.   if budHotSpotNum = 1 then
  16.     return "RomA"
  17.   else
  18.     if budHotSpotNum = 2 then
  19.       return "RomB"
  20.     else
  21.       if budHotSpotNum = 3 then
  22.         return "RomC"
  23.       else
  24.         if budHotSpotNum = 4 then
  25.           return "RaveA"
  26.         else
  27.           if budHotSpotNum = 5 then
  28.             return "RaveB"
  29.           else
  30.             if budHotSpotNum = 6 then
  31.               return "RaveC"
  32.             else
  33.               if budHotSpotNum = 7 then
  34.                 return "RantA"
  35.               else
  36.                 if budHotSpotNum = 8 then
  37.                   return "RantB"
  38.                 else
  39.                   if budHotSpotNum = 9 then
  40.                     return "RantC"
  41.                   else
  42.                     resetAnimationCursor()
  43.                     alert("PROGRAMMER: An invalid bud value" && budHotSpotNum && "was passed to getBudPath!  Use 1 through 9.")
  44.                   end if
  45.                 end if
  46.               end if
  47.             end if
  48.           end if
  49.         end if
  50.       end if
  51.     end if
  52.   end if
  53. end
  54.  
  55. on findSounds
  56.   set myText to EMPTY
  57.   cursor(4)
  58.   repeat with x = 1 to the number of castMembers
  59.     if (x mod 250) = 0 then
  60.       put x
  61.     end if
  62.     if the castType of cast x <> #inactive then
  63.       if the scriptText of cast x <> EMPTY then
  64.         set myText to the scriptText of cast x
  65.         findSoundName(myText)
  66.       end if
  67.     end if
  68.   end repeat
  69.   cursor(-1)
  70. end
  71.  
  72. on findSoundName myText
  73.   repeat with n = 1 to the number of lines in myText
  74.     if line n of myText contains "playfile" then
  75.       put line n of myText
  76.     end if
  77.   end repeat
  78. end
  79.  
  80. on findPurges
  81.   cursor(4)
  82.   repeat with x = 1 to the number of castMembers
  83.     if (x mod 250) = 0 then
  84.       put x
  85.     end if
  86.     if the purgePriority of cast x <> 3 then
  87.       set myPurge to the purgePriority of cast x
  88.       if myPurge = 0 then
  89.         set purgeLevel to "Never"
  90.       else
  91.         if myPurge = 1 then
  92.           set purgeLevel to "Last"
  93.         else
  94.           if myPurge = 2 then
  95.             set purgeLevel to "Second"
  96.           end if
  97.         end if
  98.       end if
  99.       put "Cast" && x & ":" && purgeLevel
  100.     end if
  101.   end repeat
  102.   cursor(-1)
  103. end
  104.  
  105. on findAllInks
  106.   findInkds(1, the lastFrame)
  107. end
  108.  
  109. on findInks startFrame, endFrame
  110.   cursor(4)
  111.   put "Starting at frame" && startFrame
  112.   repeat with n = 1 to 48
  113.     set the visible of sprite n to 0
  114.   end repeat
  115.   repeat with x = startFrame to endFrame
  116.     if (x mod 250) = 0 then
  117.       put "Working at frame" && x
  118.     end if
  119.     go(x)
  120.     repeat with n = 1 to 48
  121.       if (the ink of sprite n <> 8) and (the ink of sprite n <> 0) then
  122.         put "Frame" && x && "Sprite" && n & ":" && the ink of sprite n
  123.       end if
  124.     end repeat
  125.   end repeat
  126.   repeat with n = 1 to 48
  127.     set the visible of sprite n to 1
  128.   end repeat
  129.   put "Finished at frame" && endFrame
  130.   cursor(-1)
  131. end
  132.  
  133. on vizzy
  134.   repeat with n = 1 to 48
  135.     set the visible of sprite n to 1
  136.   end repeat
  137. end
  138.  
  139. on findcast myCast
  140.   cursor(4)
  141.   repeat with n = 1 to 48
  142.     set the visible of sprite n to 0
  143.   end repeat
  144.   repeat with x = 1 to the lastFrame
  145.     if (x mod 250) = 0 then
  146.       put "Working at frame" && x
  147.     end if
  148.     go(x)
  149.     repeat with n = 1 to 48
  150.       if the castNum of sprite n = myCast then
  151.         put "Frame" && x && "Sprite" && n & ":" && the castNum of sprite n
  152.       end if
  153.     end repeat
  154.   end repeat
  155.   repeat with n = 1 to 48
  156.     set the visible of sprite n to 1
  157.   end repeat
  158.   cursor(-1)
  159. end
  160.  
  161. on findScript startFrame, myScriptNum
  162.   cursor(4)
  163.   repeat with x = startFrame to the lastFrame
  164.     if (x mod 250) = 0 then
  165.       put x
  166.     end if
  167.     go(x)
  168.     if the frameScript = myScriptNum then
  169.       put "Cast" && x & ":" && myScriptNum
  170.     end if
  171.   end repeat
  172.   cursor(-1)
  173. end
  174.  
  175. on countletters myField
  176.   cursor(4)
  177.   set myString to the text of cast myField
  178.   repeat with x = 1 to the number of words in myString
  179.     if length(word x of myString) > 8 then
  180.       put word x of myString
  181.     end if
  182.   end repeat
  183.   cursor(-1)
  184. end
  185.  
  186. on ReturnTo5thAve fromModuleLabel
  187.   global fileSep
  188.   sound stop 1
  189.   sound playFile 2, the pathName & "Daudio" & fileSep & "bum30.Aif"
  190.   go(1, "D5thAve")
  191. end
  192.